package shuogg.service;

import shuogg.dao.UserDao;
import shuogg.domain.User;

public class UserService {

    private UserDao dao;
    

    public UserDao getDao() {
        return dao;
    }

    public void setDao(UserDao dao) {
        this.dao = dao;
    }

    public void updateUserInfo(User user) {
        dao.update(user);
        System.out.println("User info changed success");
    }

    public void addUser(User user) {
        dao.insert(user);
        System.out.println("User info add success");
    }
    
    public void delUserByID(int id) {
        dao.delete(id);
        System.out.println("One user is deleted");
    }
    
    public User getUserById(int id) { 
        return dao.getById(id);
    }
}
